<%@page import="com.lewin.ConnectDB"%>
<%@page import="com.lewin.SanPham"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
 pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="NewFile.css" />
<title>Product Information</title>
</head>
<body>

<div id="page">

  <a href="Home.jsp" id="top"><img src="C:\Users\suker\workspace\DoAnCuoiKi\WebContent\WEB-INF\Images\banner.jpg" 
  alt="banner" width="950px" height="auto" /></a>
  <div id="navigation" style="border-top:1px solid #d6d6d6;
	border-bottom:1px solid #d6d6d6">
    <a href="Home.jsp">HOME</a>
    <a href="index.jsp">LIST OF PRODUCT</a>
  </div>
  
  <div style="text-align: right" >
  <select name="selMH">
   <option selected="selected" value="">Tên mặt hàng</option>
   <option value="DonGiaLonHon">Giá lớn hơn</option>
   <option value="DonGiaNhoHon">Giá nhỏ hơn</option>
   
</select>
  <input type="text" name="search"  />
  <input type="submit" value="Search" class="search"/>
  </div>
  <table cellspacing="10px" cellpadding="10px" >
  <tr></tr>
  <tr></tr>
  <tr></tr>
  <tr style="border-top:1px solid #d6d6d6">
  <td style="background-color: #333333;color:white;text-align: left">Mã sản phẩm</td>
  <td style="background-color: #333333;color:white;text-align: left">Tên sản phẩm</td>
  <td style="background-color: #333333;color:white;text-align: left">Loại sản phẩm</td>
  <td style="background-color: #333333;color:white;text-align: left">Đơn giá</td>
  <td style="background-color: #333333;color:white;text-align: center">Hình</td>
  </tr>
 <% ArrayList<SanPham> lst = new ConnectDB().getAllProducts(); %>
 <%
 for(SanPham sp : lst){
 String editURL = "Edit.jsp?MaMH="+sp.getMaMH();
 String deleteURL = "Delete?MaMH="+sp.getMaMH();
 %>
 <tr>
 <td><%=sp.getMaMH() %></td>
 <td><%=sp.getTenMH() %></td>
 <td><%=sp.getLoaiMH() %></td>
 <td><%=sp.getDonGia() %></td>
 <td><img src="<%=sp.getHinh() %>" alt="image" width="100px" height="100px"/></td>
 <td><a href="<%=editURL%>">Edit</a></td>
 <td><a href="<%=deleteURL%>">Delete</a></td>
 </tr>
 <%
 }
 %>
 </table>
  <div style="text-align: right">
  <ul id="navigation">
  <li><a href="Insert.jsp">Insert</a></li>
   </ul>
  </div>
  </div>
</body>
</html>